package com.lzdongrui.backend.service.impl;

import java.util.List;

import com.lzdongrui.backend.domain.dto.ApplyLeaveAuditDTO;
import com.lzdongrui.backend.domain.vo.ApplyLeaveAuditVO;
import com.lzdongrui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lzdongrui.backend.mapper.ApplyLeaveAuditMapper;
import com.lzdongrui.backend.domain.ApplyLeaveAudit;
import com.lzdongrui.backend.service.IApplyLeaveAuditService;

/**
 * 请假审核Service业务层处理
 * 
 * @author wyh
 * @date 2023-05-19
 */
@Service
public class ApplyLeaveAuditServiceImpl implements IApplyLeaveAuditService
{
    @Autowired
    private ApplyLeaveAuditMapper applyLeaveAuditMapper;

    /**
     * 查询请假审核
     * 
     * @param id 请假审核主键
     * @return 请假审核
     */
    @Override
    public ApplyLeaveAudit selectApplyLeaveAuditById(Long id)
    {
        return applyLeaveAuditMapper.selectApplyLeaveAuditById(id);
    }

    /**
     * 查询请假审核列表
     * 
     * @param applyLeaveAuditDTO 请假审核
     * @return 请假审核
     */
    @Override
    public List<ApplyLeaveAuditVO> selectApplyLeaveAuditList(ApplyLeaveAuditDTO applyLeaveAuditDTO)
    {
        return applyLeaveAuditMapper.selectApplyLeaveAuditList(applyLeaveAuditDTO);
    }

    /**
     * 新增请假审核
     * 
     * @param applyLeaveAudit 请假审核
     * @return 结果
     */
    @Override
    public int insertApplyLeaveAudit(ApplyLeaveAudit applyLeaveAudit)
    {
        applyLeaveAudit.setCreateTime(DateUtils.getNowDate());
        return applyLeaveAuditMapper.insertApplyLeaveAudit(applyLeaveAudit);
    }

    /**
     * 修改请假审核
     * 
     * @param applyLeaveAudit 请假审核
     * @return 结果
     */
    @Override
    public int updateApplyLeaveAudit(ApplyLeaveAudit applyLeaveAudit)
    {
        applyLeaveAudit.setUpdateTime(DateUtils.getNowDate());
        return applyLeaveAuditMapper.updateApplyLeaveAudit(applyLeaveAudit);
    }

    /**
     * 批量删除请假审核
     * 
     * @param ids 需要删除的请假审核主键
     * @return 结果
     */
    @Override
    public int deleteApplyLeaveAuditByIds(Long[] ids)
    {
        return applyLeaveAuditMapper.deleteApplyLeaveAuditByIds(ids);
    }

    /**
     * 删除请假审核信息
     * 
     * @param id 请假审核主键
     * @return 结果
     */
    @Override
    public int deleteApplyLeaveAuditById(Long id)
    {
        return applyLeaveAuditMapper.deleteApplyLeaveAuditById(id);
    }


    /**
     * 查对应申请数据的所有审核数据
     *
     * @param applyLeaveAudit
     * @return
     */
    @Override
    public List<ApplyLeaveAudit> FindIdGetlist(ApplyLeaveAudit applyLeaveAudit) {
        return applyLeaveAuditMapper.FindIdGetlist(applyLeaveAudit);
    }

}
